<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/public/header.jsp"%>

<html>
	<head>
		<title>部门材料库存</title>
	</head>
	<script type="text/javascript">
	$(function(){
			var arr=new Array("客户库","甲供库","工余料库","订单料库","厂家库");
			var arrUrl=new Array(
							 "beforeDBManage.jsp",
							 "jGDBManage.jsp",
							 "myDBManage.jsp",
							 "purchaseApplyDBManage.jsp",
							 "supplierDBManage.jsp"
		                     );
			
			for(var i=0;i<arr.length;i++){
				if($("#tt").tabs('exists',arr[i])){
					$("#tt").tabs('select',arr[i]);
				}else{
					$('#tt').tabs('add',{  
	   				title:arr[i],
	   				closable:false,
	   				content:'<iframe frameborder="0" src="" style="width:100%;height:99%;" scrolling="auto"></iframe>'
					});  
				}
			}
			
			 $('#tt').tabs({  
   				onSelect:function(title,index){
				 	var tab = $(this).tabs('getTab',title);
				 	for(var i=0;i<arr.length;i++){
				 		if(index == i){
				 			tab.find('iframe').attr('src',arrUrl[index]);
				 		}
				 	}
		   		}
			});  
		});
	</script>
	<body>
		<div class="easyui-layout" data-options="fit:true">
		 <div region="center" >
			<div id="tt" class="easyui-tabs"  data-options="fit:true">  
		 	</div>
   		</div>  
   	</div>
	</body>
</html>
